import Vue from 'vue'
import Router from 'vue-router'
import axios from 'axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import FileContent from "../components/FileContent.vue"

// 获取ｉｐ
var pattern = /((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/g
var ip = pattern.exec(window.location.href)
if (ip == null) {
  axios.defaults.baseURL = "http://localhost:8888"
} else {
  axios.defaults.baseURL = "http://" + ip[0] + ":8888"
}
Vue.config.productionTip = false
Vue.prototype.$axios = axios
Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.use(Router)

export default new Router({
  routes: [
    {path: "/", name: "FileContent", component: FileContent}
  ]
})
